<template>
  <div class="main-root">
    <img class="wall-paper" src="http://121.37.209.61:8080/upload/wallPaper/kasa.jpg" alt="">
    <MainLayout>
      <template v-slot:main-nav>
        <Nav :headImg="headImg"></Nav>
      </template>
      <template v-slot:main-menu>
        <Menu></Menu>
      </template>
      <template v-slot:main-router>
        <router-view />
      </template>
    </MainLayout>
  </div>
</template>

<script>
import Nav from "@/components/Nav.vue"
import Menu from "@/components/Menu.vue"
import MainLayout from '@/layout/main'
export default {
  components: {
    MainLayout,
    Nav,
    Menu
  },
  data() {
    return {
      headImg: ''
    }
  },
  created() {
    //默认右侧打开home 
    this.$router.push('/main/home')
    //检测登录
    if (this.$route.query.name) {
      this.$message.success(`欢迎您！${this.$route.query.name}`)
    }
    //获取用户头像
    this.getHeadImg()
  },
  methods: {
    getHeadImg() {
      let user = JSON.parse(sessionStorage.getItem('user'))
      this.headImg = user.img || ''
    }
  },
}
</script>

<style scoped>
.main-root {
  height: 100%;
}

.wall-paper {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  z-index: -99;
  object-fit: cover;
}

>>>.el-table {
  background: none;
  color: #fff;
}

>>>.el-table tr {
  background: none;
  color: #fff;
}

>>>.el-table__row {
  background: none;
}

>>>.el-table__cell {
  background: none !important;
}

>>>.el-table__fixed-right-patch {
  background: none;
}
</style>